// 餐厅相关类型
export interface Restaurant {
  id: string
  name: string
  category: string
  frequency_rule: 'daily' | 'weekly' | 'monthly'
  notes?: string
  created_at: string
  updated_at: string
}

export interface CreateRestaurantDto {
  name: string
  category: string
  frequencyRule: 'daily' | 'weekly' | 'monthly'
  notes?: string
}

export interface UpdateRestaurantDto {
  name?: string
  category?: string
  frequencyRule?: 'daily' | 'weekly' | 'monthly'
  notes?: string
}

// 分页餐厅响应
export interface PaginatedRestaurants {
  data: Restaurant[]
  total: number
  page: number
  pageSize: number
  totalPages: number
}

// 抽签历史相关类型
export interface DrawHistory {
  id: string
  restaurant_id: string
  restaurant_name: string
  category: string
  drawn_at: string
  is_redrawn: boolean
  created_at: string
  restaurant?: Restaurant
}

// 抽签过滤条件
export interface DrawFilterDto {
  categories?: string[]
  excludeMarked?: boolean
}

export interface DrawResponse {
  restaurant: Restaurant
  drawHistory: DrawHistory
}

// 分页抽签历史响应
export interface PaginatedDrawHistory {
  data: DrawHistory[]
  total: number
  page: number
  pageSize: number
  totalPages: number
}

// 抽签统计
export interface DrawStats {
  totalDraws: number
  todayDraws: number
  weekDraws: number
  monthDraws: number
}

// 餐厅抽签次数统计
export interface RestaurantDrawCount {
  restaurantId: string
  restaurantName: string
  category: string
  count: number
}

// 餐厅标记相关类型
export interface RestaurantMark {
  id: string
  restaurant_id: string
  restaurant_name: string
  mark_type: 'today' | 'week'
  created_at: string
  expires_at: string
}

export interface CreateMarkDto {
  restaurantId: string
  markType: 'today' | 'week'
}

// 分页标记响应
export interface PaginatedMarks {
  data: RestaurantMark[]
  total: number
  page: number
  pageSize: number
  totalPages: number
}

// 餐厅标记检查
export interface RestaurantMarkCheck {
  isMarked: boolean
  markType?: 'today' | 'week' | null
  expiresAt?: string | null
}

// 标记统计
export interface MarkStats {
  totalMarks: number
  todayMarks: number
  weekMarks: number
  activeMarks: number
}

// API响应基础类型
export interface ApiResponse<T = any> {
  success: boolean
  message: string
  data?: T
  timestamp: string
}

export interface ErrorResponse {
  success: false
  message: string
  error?: string
  timestamp: string
}

// 分页相关类型
export interface PaginationParams {
  page?: number
  pageSize?: number
  sort?: string
  order?: 'asc' | 'desc'
}

// 筛选相关类型
export interface RestaurantFilters {
  category?: string
  frequencyRule?: 'daily' | 'weekly' | 'monthly'
  search?: string
}

// 日期筛选
export interface DateFilter {
  startDate?: string
  endDate?: string
}

// 兼容性类型别名（保持向后兼容）
export type CreateRestaurantRequest = CreateRestaurantDto
export type UpdateRestaurantRequest = UpdateRestaurantDto
export type CreateMarkRequest = CreateMarkDto